$OpenBSD: patch-Scripts_sql-update-1_3_16_to_1_3_17_sh,v 1.1 2012/08/17 09:59:08 sebastia Exp $
--- Scripts/sql-update-1.3.16_to_1.3.17.sh.orig	Thu Jul 26 19:45:02 2012
+++ Scripts/sql-update-1.3.16_to_1.3.17.sh	Thu Jul 26 19:46:21 2012
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 set -e 
 # This script only works with PostgreSQL
@@ -11,15 +11,15 @@ defaultusername=$USER
 defaulthostname=localhost
 defaultdatabase=$USER
 #indextable=sogo_folder_info
-indextable=$(su - sogo -c "defaults read sogod OCSFolderInfoURL" | awk -F/ '{print $NF}')
+indextable=$(defaults read sogod OCSFolderInfoURL | awk -F/ '{print $NF}')
 if [ -z "$indextable" ]; then
   echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2
   exit 1
 fi
 
-read -p "Username ($defaultusername): " username
-read -p "Hostname ($defaulthostname): " hostname
-read -p "Database ($defaultdatabase): " database
+read username?"Username ($defaultusername): "
+read hostname?"Hostname ($defaulthostname): "
+read database?"Database ($defaultdatabase): "
 
 if [ -z "$username" ]
 then
@@ -36,7 +36,7 @@ fi
 
 sqlscript=""
 
-function growVC() {
+growVC() {
     oldIFS="$IFS"
     IFS=" "
     part="`echo -e \"ALTER TABLE $table ALTER COLUMN c_cycleinfo TYPE VARCHAR(1000000);\\n\"`";
